package com.vlin.config.scheduler;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class VlinScheduler {

	@Bean
	public Scheduler scheduler() throws SchedulerException {
		
		SchedulerFactory sf = new StdSchedulerFactory();
		Scheduler sched = sf.getScheduler();
		if(!sched.isStarted()) {
			sched.start();
		}
		return sched;
	}

}
